import request from "@/utils/request";

/**  客户数据分页查询参数 */
export interface ClientPageQuery {
  current?: number;
  pageSize?: number;
  cityNo?: string;
  lawFirmId?: string;
  lawyerId?: number;
  clientName?: string;
  keywords?: string;
}
/** 客户表单 */
export interface ClientForm {
  lawyerName?: string;
  lawyerId?: number;
  lawFirmId?: number;
  lawFirmName?: string;
  id?: number;
  caseId?: string | null;
  clientCityName?: string;
  clientCityNo?: string;
  clientIp?: string;
  clientName?: string;
  clientPhone?: string;
  clientWxAvatar?: string | null;
  clientWxName?: string;
  createdAt?: string;
  email?: string | null;
  gender?: string;
  openid?: string | null;
  updateAt?: string;
  userType?: string;
}
/** 客户数据分页对象 */
export interface ClientPageVO {
  current: number;
  pages: number;
  records: any;
  size: number;
  total: number;
}
class clientAPI {
  /** 获取客户数据分页列表 */
  static getclientPage(params: ClientPageQuery) {
    return request<any, ClientPageVO>({
      url: "/api/client_user/getPage",
      method: "post",
      data: params,
    });
  }
  /** 新增+修改 客户信息 */
  static updateClient(params: ClientForm) {
    return request<any, PageResult<ClientPageVO[]>>({
      url: "/api/client_user",
      method: "post",
      data: params,
    });
  }
  /** 批量删除客户信息 */
  static deleteClientBatch(ids: string) {
    return request({
      url: `/api/client_user/deleteBatch?ids=${ids}`,
      method: "delete",
      // data: params,
    });
  }
  /** 绑定律师 */
  static clientBindLawyer(params: any) {
    return request({
      url: "/api/client_user/setLawyerUser",
      method: "post",
      data: params,
    });
  }
}

export default clientAPI;
